﻿using SmartHRMS.Model.Account;
using StructureMap;
using SmartHRMS.Infrastructure;

namespace SmartHRMS.Presentation.Account
{
    public class PrincipalPresenter
    {
        private IPrincipalService customPrincipalService;

        public PrincipalPresenter()
            : this(ObjectFactory.GetInstance<IPrincipalService>())
        {
        }

        public PrincipalPresenter(IPrincipalService customPrincipalService)
        {
            this.customPrincipalService = customPrincipalService;
        }


        public void LoadUserByUserName(string userName)
        {
            customPrincipalService.LoadUserByUserName(userName);
        }

        public LoginResults ValidateLogin(string userName, string password)
        {
            return customPrincipalService.Login(userName,password);
        }

        public void Logout()
        {
            customPrincipalService.Logout();
        }
    }
}
